let $info = $('.info')

let init = {
    url: 'http://chst.vip:1234/api/getcoupon',
    success: title
}
ajaxAPI(init)
function title(res) {
    console.log(res)
    let result = res.result
    console.log(result)
    let infoStr = ''
    result.forEach(item => {
       
        infoStr += `
<li id='${item.couponId}'>
<a href=''>
<img src='${item.couponImg}' alt=''>
<p>
${item.couponTitle}
</p>
</a>
</li>
`
    })
    $info.html(infoStr)
}

$info.on('click','li',function(e){
    e.preventDefault()
console.log(123)
    let id = $(this).attr('id');
    console.log(id);
    window.location.href='../pages/couponitems.html?couponId=' + id

  })



